﻿Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Shapes
Imports WinInterop = System.Windows.Interop
Imports System.Runtime.InteropServices

Namespace Views
    Partial Public Class ViewMainWindow
        Inherits CustomWindow.PT_CustomWindow

        Protected Overrides Function GetWindowButtonsPlaceholder() As System.Windows.Controls.Decorator
            Return WindowButtonsPlaceholder
        End Function

        Private Sub GridTitle_MouseLeftButtonDown(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles GridTitle.MouseLeftButtonDown
            DragMove()
        End Sub

        Private Sub Thumb_DragDelta(ByVal sender As Object, _
                                    ByVal e As System.Windows.Controls.Primitives.DragDeltaEventArgs)
            With Me
                If Not .WindowState = WindowState.Maximized Then
                    If (.Width + e.HorizontalChange > 10) Then .Width = .Width + e.HorizontalChange
                    If (.Height + e.VerticalChange > 10) Then .Height = .Height + e.VerticalChange
                End If
            End With
        End Sub
    End Class
End Namespace
